﻿using System;
using System.Collections.Generic;
using System.Text;
using Cn.Edwon.Biz;
using Cn.Cellula.Model;
using System.Collections;
using Cn.Cellula.Model.Product;

namespace Cn.Cellula.Biz.Port {
    public interface IProductBiz : IBiz {
        
        /// <summary>
        /// 根据产品获取产品所有的图片
        /// </summary>
        /// <param name="rProductKey"></param>
        /// <returns></returns>
        IList<TProductPicEO> LoadPicByProduct(String rProductKey);

        /// <summary>
        /// 根据product key获取该产品所在的卖场或商铺
        /// </summary>
        /// <param name="rProductKey"></param>
        /// <returns></returns>
        IList<TProductInMarketEO> LoadProductMarket(String rProductKey);
        /// <summary>
        /// 更新产品所属的店铺信息
        /// </summary>
        /// <param name="rProductKey"></param>
        /// <param name="rMarketKeys"></param>
        void UpdateProductMarket(String rOwnerKey,String rProductKey, String[] rMarketKeys);
        /// <summary>
        /// 生成商品编号
        /// </summary>
        /// <returns></returns>
        String GenerateProductNo();
        /// <summary>
        /// 商品编号是否已存在
        /// </summary>
        /// <returns></returns>
        Boolean IfProductNoExist(String rProductNo);
        /// <summary>
        /// 批量删除产品
        /// </summary>
        /// <param name="rKeys"></param>
        void DeleteProduct(IList<String> rKeys);
        /// <summary>
        /// 向组中增加商品
        /// </summary>
        /// <param name="rProductKeys"></param>
        /// <param name="rGroupKey"></param>
        void BindProductInGroup(IList<String> rProductKeys, String rGroupKey);
        /// <summary>
        /// 向组中移除商品
        /// </summary>
        /// <param name="rProductKeys"></param>
        /// <param name="rGroupKey"></param>
        void BindProductOutGroup(IList<String> rProductKeys, String rGroupKey);
        /// <summary>
        /// 获取一个产品所属的卖场
        /// </summary>
        /// <param name="rProductKey"></param>
        IList<VProductInMarketEO> LoadMarketByProduct(String rProductKey);
        /// <summary>
        /// 获取一个产品的详细信息
        /// </summary>
        /// <param name="rKey"></param>
        /// <returns></returns>
        String LoadProductDetails2Json(String rKey);

        /// <summary>
        /// 设置商品上架
        /// </summary>
        /// <param name="rKeys"></param>
        void SetList(IList<String> rKeys);
        /// <summary>
        /// 设置商品下架
        /// </summary>
        /// <param name="rKeys"></param>
        void SetDelist(IList<String> rKeys);

        #region 属性模板
        /// <summary>
        /// 根据alt key获取options列表
        /// </summary>
        /// <param name="rAtlKey"></param>
        /// <returns></returns>
        IList<TProductAtlOptionsEO> LoadAltOptions(String rAtlKey);
        /// <summary>
        /// 删除一个或多个属性模板
        /// </summary>
        /// <param name="rAltKey"></param>
        void DeleteAlt(IList<String> rAltKeys);
        /// <summary>
        /// 删除一个或多个属性选择项
        /// </summary>
        /// <param name="rOptKey"></param>
        void DeleteAltOption(IList<String> rOptKeys);
        /// <summary>
        /// 根据分类获取所有的atl
        /// </summary>
        /// <param name="rCategoryKey"></param>
        /// <returns></returns>
        IList<VProductAtlEO> LoadProductAtlByCategory(String rCategoryKey);

        void SaveProductAtlData(IList<TProductAtlDataEO> rDataList);
        IList<VProductAtlOptionsEO> LoadProductOptByCategory(string rCategoryKey);
        #endregion
    }
}
